<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
    <script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
    <!-- 生产环境中不建议使用 -->
    <script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app"></div>
</body>


<script>
    //面向对象基础用法
    class guoXiao {
        constructor(name, age) { //默认执行constructor 方法, 不支持变量提升
            // this 初始私有属性 
            console.log(name, age)
            this.a = 10;
            this.name = name;
        }

        show(x) { //原型 
            alert(x)
            console.log(this.name)
        }

        to() {
            alert('guoX');
            alert(this.a);
        }
    };




    // new guoXiao('guoxiao', 24).show('m')

    // 继承  extends

    class guoX extends guoXiao {
        constructor(x){
            super(x); 
            //1.在子类的构建函数中,先使用 super() 才能使用this    
            //2.参数继承
            this.a = 20;
        }
    }
    new guoX('big').to();



//    console.log(typeof new guoxiao)
</script>

</html>